/*
 * @Description:
 * @Version: 2.0
 * @Autor: wangmiao
 * @Date: 2022-07-25 09:55:10
 * @LastEditors: wangmiao
 * @LastEditTime: 2022-07-25 10:20:49
 */
import { defineStore } from "pinia";
import { ref } from "vue";
// 使用options API模式定义
export const useCounterStoreForOption = defineStore("counterForOptions", () => {
  const count = ref<number>(0);
  const increment = () => {
    count.value++;
  };

  const doubleCount = () => {
    return count.value * 2;
  };

  const incrementTow = () => {
    count.value = count.value * 2;
  };

  return { count, increment, doubleCount, incrementTow };
});
